﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

// NotReviewedButNeeded
#pragma once

#include "GcmpDevService.h"
#ifdef __cplusplus
    #include "gbmp_cassert.h"
#else
    #include "gbmp_assert.h"
#endif
#include <algorithm>
#include <functional>
#include <vector>

namespace gcmp
{
    // Assert工具类
    class GCMP_DEV_SERVICE_EXPORT AssertHelper
    {
    private:
        AssertHelper() {}

        ~AssertHelper() {}
    public:
        static AssertHelper* GetInstance();

        void RegisterAsPreShowListener(std::function<void()> listener);

        void Assert(const std::wstring &text, const std::wstring &fileName, int line) const;

    private:
        std::vector<std::function<void()> > m_preShowListeners;
    };
}
